Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(expr): type-safe infallible evaluation #12921

Merged
merged 9 commits into from
Oct 24, 2023

Conversation

BugenZhao
Copy link
Member

@BugenZhao BugenZhao commented Oct 17, 2023

Signed-off-by: Bugen Zhao [email protected]I hereby agree to the terms of the RisingWave Labs, Inc. Contributor License Agreement.

What's changed and what's your intention?

Introduce a type-safe wrapper NonStrictExpression indicating that we can safely (without panic) unwrap the evaluation result. It can either be constructed with non-strict build functions like build_non_strict_from_prost, or with new_topmost that wraps the topmost expression node only as a TODO.

To make this happen, we separate boxed into an extension trait to enable non-static expression implementations, so that we can call new_topmost with an expression reference.

This is a follow-up of #12461 and preparation of #12474.

Checklist

  • I have written necessary rustdoc comments
  • I have added necessary unit tests and integration tests
  • All checks passed in ./risedev check (or alias, ./risedev c)

Documentation

  • My PR needs documentation updates. (Please use the Release note section below to summarize the impact on users)

Release note

If this PR includes changes that directly affect users or other significant modifications relevant to the community, kindly draft a release note to provide a concise summary of these changes. Please prioritize highlighting the impact these changes will have on users.

Signed-off-by: Bugen Zhao <[email protected]>
Signed-off-by: Bugen Zhao <[email protected]>
Signed-off-by: Bugen Zhao <[email protected]>
@BugenZhao BugenZhao changed the title refactor(expr): type-safe non-strict expression refactor(expr): type-safe infallible evaluation Oct 17, 2023
Signed-off-by: Bugen Zhao <[email protected]>
@BugenZhao BugenZhao force-pushed the bz/type-safe-infallible-evaluation branch from 10dd303 to 9edb4cc Compare October 17, 2023 13:28
Signed-off-by: Bugen Zhao <[email protected]>
Signed-off-by: Bugen Zhao <[email protected]>
Signed-off-by: Bugen Zhao <[email protected]>
@codecov
Copy link

codecov bot commented Oct 18, 2023

Codecov Report

Merging #12921 (f47cd7e) into main (4851983) will decrease coverage by 0.07%.
Report is 5 commits behind head on main.
The diff coverage is 91.96%.

@@            Coverage Diff             @@
##             main   #12921      +/-   ##
==========================================
- Coverage   68.70%   68.64%   -0.07%     
==========================================
  Files        1495     1495              
  Lines      251092   251134      +42     
==========================================
- Hits       172521   172380     -141     
- Misses      78571    78754     +183     
Flag Coverage Δ
rust 68.64% <91.96%> (-0.07%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Coverage Δ
src/batch/src/executor/aggregation/filter.rs 96.22% <ø> (ø)
src/batch/src/executor/project_set.rs 74.46% <ø> (ø)
src/expr/core/src/expr/wrapper/checked.rs 70.00% <ø> (ø)
src/expr/impl/src/scalar/cast.rs 86.15% <ø> (ø)
...rc/expr/impl/src/table_function/generate_series.rs 87.27% <ø> (ø)
src/frontend/src/handler/create_mv.rs 93.72% <100.00%> (ø)
...c/frontend/src/optimizer/plan_node/batch_delete.rs 75.00% <100.00%> (-2.15%) ⬇️
...c/frontend/src/optimizer/plan_node/batch_expand.rs 46.34% <100.00%> (ø)
...c/frontend/src/optimizer/plan_node/batch_filter.rs 97.61% <100.00%> (ø)
...ontend/src/optimizer/plan_node/batch_group_topn.rs 58.97% <100.00%> (-2.94%) ⬇️
... and 109 more

... and 20 files with indirect coverage changes

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

Copy link
Member

@stdrc stdrc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rest LGTM

src/expr/core/src/expr/mod.rs Show resolved Hide resolved
src/expr/core/src/expr/mod.rs Show resolved Hide resolved
src/expr/core/src/expr/mod.rs Show resolved Hide resolved
src/storage/src/row_serde/value_serde.rs Show resolved Hide resolved
@BugenZhao BugenZhao added this pull request to the merge queue Oct 24, 2023
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Oct 24, 2023
@BugenZhao BugenZhao enabled auto-merge October 24, 2023 08:47
@BugenZhao BugenZhao added this pull request to the merge queue Oct 24, 2023
Merged via the queue into main with commit 88a8331 Oct 24, 2023
6 of 7 checks passed
@BugenZhao BugenZhao deleted the bz/type-safe-infallible-evaluation branch October 24, 2023 09:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants